unit uTest;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    btn1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure btn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

procedure DllMessage; external 'TestDll.dll';

procedure RaiseDllExceptionProc; external 'TestDll.Dll';

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  DllMessage;
end;

procedure TForm1.btn1Click(Sender: TObject);
begin
  try
    RaiseDllExceptionProc;
  except
    on E: Exception do
      ShowException(E, ExceptAddr);
  end;
end;

end.

